var AV = require('leanengine');
require('./cloud/tribeHook.js');
require('./cloud/tools/tools')
require('./cloud/SomethingDo')
let common = require('./cloud/common')
let xlsxParser = require('./cloud/XLSXManager.js')

// require( './cloud/user' );
/**
 * 一个简单的云代码方法
 */
AV.Cloud.define('saveXlsxFromShopGoodType', function(request) {
    xlsxParser.saveXlsxFromShopGoodType();
  return 'Hello world!';
});

AV.Cloud.define('inputXlsxFromShopGoodType', function(request) {
    xlsxParser.inputXlsxFromShopGoodType();
    return 'Hello world!';
});

AV.Cloud.define('hello', function(request) {
    return 'Hello world!';
});
AV.Cloud.define('postageCompute', function(request,response) {
  // console.log('postageComputeRequest',request.params)
  common.postageCompute(request.params,function (result) {
    return response.success(result)
  })

});
// AV.Cloud.afterUpdate('Tribe', function(request) {
//   console.log('afterUpdate')
// });
module.exports = {
  io: require('./cloud/qiniu/io.js'),
  rs: require('./cloud/qiniu/rs.js'),
  rsf: require('./cloud/qiniu/rsf.js'),
  fop: require('./cloud/qiniu/fop.js'),
  conf: require('./cloud/qiniu/conf.js'),
  rpc: require('./cloud/qiniu/rpc.js'),
  util: require('./cloud/qiniu/util.js')
};
module.exports = AV.Cloud;